#define _CRT_SECURE_NO_WARNINGS 1
int Count_Digit(const int N, const int D)
{
    int count = 0;
    int n = N;
    if (n < 0)
        n = -N;
    while (n)
    {
        if (n % 10 == D)
        {
            count++;
        }
        n /= 10;
    }
    if (N == 0 && N == D)
        count++;
    return count;
}